/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package adapter;

/**
 *
 * @author carlosarboleda
 */
public class AdapterPromedio extends AdapterEstadisticas {
    
    private Promedio promedio;
    
    public AdapterPromedio(){
        promedio= new Promedio();
    }

    @Override
    public void setData(int[] datos) {

        double[] d = new double[datos.length];
        for (int i = 0; i < datos.length; i++) {
            d[i]= (double)datos[i];

        }

        promedio.setDatos(d);
    }

    @Override
    public double calcularOperacion() {

        double r = promedio.promediar();
        return r;

    }

    @Override
    public String nombreOperacion() {
        return "Promedio ";
    }



}
